#include <iostream>
#include <iomanip>
#include <math.h>
using namespace std;

class vector{
  private:
    float coords[3];
  public:
    vector(int x=0,int y=0,int z=0){
	  coords[0] = x;
	  coords[1] = y;
	  coords[2] = z;
	}
	vector(vector & obj){
	  coords[0] = obj.coords[0];
	  coords[1] = obj.coords[1];
	  coords[2] = obj.coords[2];
	}
	void stretch(float koeff){
	  coords[0] *= koeff;
	  coords[1] *= koeff;
	  coords[2] *= koeff;
	}
	void single(void){
	  float len = pow(coords[0],2);
	  len += pow(coords[1],2);
	  len += pow(coords[2],2);
	  len = sqrt(len);
	  stretch(1/len);
	}
	friend vector& operator + (vector& obj1, vector& obj2){
	  static vector tempplus;
	  tempplus.coords[0]=obj1.coords[0]+obj2.coords[0];	  
	  tempplus.coords[1]=obj1.coords[1]+obj2.coords[1];
	  tempplus.coords[2]=obj1.coords[2]+obj2.coords[2];
	  return tempplus;
	}
	friend vector& operator - (vector& obj1, vector& obj2){
	  static vector tempplus;
	  tempplus.coords[0]=obj1.coords[0]-obj2.coords[0];	  
	  tempplus.coords[1]=obj1.coords[1]-obj2.coords[1];
	  tempplus.coords[2]=obj1.coords[2]-obj2.coords[2];
	  return tempplus;
	}
	friend vector& operator * (vector& obj1, float k){
	  static vector tempmult;
      tempmult.coords[0]=obj1.coords[0]*k;   
      tempmult.coords[1]=obj1.coords[1]*k;
      tempmult.coords[2]=obj1.coords[2]*k;
      return tempmult;
	}
	void print(void){
	  cout << "Vector output\n" << fixed<<setprecision(2);
	  cout << coords[0] << endl;
	  cout << coords[1] << endl;
	  cout << coords[2] << endl;
	}
	
};



int main(){
  
  vector e1(1,0,0), e2(0,1,0), e3(0,0,1);
  vector speed;
  speed = (e2*5) + (e3*2);
  
  speed.print();
  return 0;
}